/*
 *  SpaceShip.h
 *  GLRender
 *
 *  Created by Patrick zulian on 5/4/10.
 *  Copyright 2010 University  of Lugano. All rights reserved.
 *
 */

#ifndef SPACE_SHIP_H
#define SPACE_SHIP_H

#include "WMovingObject.h"

class Player;
class Bonus;

class SpaceShip : public WMovingObject {

private:
	Player *p;
	
public:
	SpaceShip(Player *p, const Point3d &position, Point3d &velocity0, const double _mass = 1.0);
	
	virtual
	~SpaceShip() { }
	
	virtual
	void renderOn(AbstractRenderer *renderer);
	
	void onCollision (WObject *from);
	
	const inline double getMaxLife() const {return 1500.0;}
	
	Player *getPlayer () { return p; }
	
	void applyBonus (Bonus *b);
	
	virtual inline void setLife(double l) {this->life=getMaxLife()<l?getMaxLife():l; }
	
	inline
	double getMinSpeed() const
	{	
		return 3.0;
	}
	
	inline
	double getMaxSpeed() const
	{
		return 30.0;
	}
	
	inline void resetAngles(){ this->rotAngle=0; this->vertAngle=0;}
};

#endif
